package com.dc.common.core;

import com.dc.common.validated.DeleteGroup;
import com.dc.common.validated.InsertGroup;
import com.dc.common.validated.SubmitGroup;
import com.dc.common.validated.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author zhuangcy
 * @date 2020/12/3
 * @description 主从表实体类
 */
@Data
public class MasterSlaveDto<M, S> {
    /**
     * 主体信息
     */
    @NotNull(message = "主体信息不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private M master;

    /**
     * 子表信息
     */
    @NotEmpty(message = "子表信息不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private ValidList<S> slaves;

    /**
     * id数组
     */
    @NotEmpty(message = "id数组不能为空", groups = {DeleteGroup.class, SubmitGroup.class})
    private List<Integer> ids;


}
